home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 31 / PC Gamer IT CD 31 1-2.iso / DINKDEMO / dink101.exe / DINK / STORY / ITEM-FST.C < prev    next >
Text File  |  1997-10-01  |  816b  |  49 lines

  1. //item fists
  2.  
  3. void use( void )
  4. {
  5. //disallow diagonal punches
  6.  
  7. if (sp_dir(1, -1) == 1)
  8.     sp_dir(1, 2);
  9. if (sp_dir(1, -1) == 3)
  10.     sp_dir(1, 2);
  11. if (sp_dir(1, -1) == 7)
  12.     sp_dir(1, 8);
  13. if (sp_dir(1, -1) == 9)
  14.     sp_dir(1, 8);
  15.  
  16. &basehit = sp_dir(1, -1);
  17. &basehit += 100; //100 is the 'base' for the hit animations, we just add
  18. //the direction
  19. sp_seq(1, &basehit);
  20. sp_frame(1, 1); //reset seq to 1st frame
  21. sp_kill_wait(1); //make sure dink will punch right away
  22. sp_nocontrol(1, 1); //dink can't move until anim is done!
  23. playsound(8, 8000,0,0,0);
  24. }
  25.  
  26. void disarm(void)
  27. {
  28. kill_this_task();
  29. }
  30.  
  31. void arm(void)
  32. {
  33. int &basehit;
  34. }
  35.  
  36. void pickup(void)
  37. {
  38. Debug("Player now owns this item.");
  39. kill_this_task();
  40. }
  41.  
  42. void drop(void)
  43. {
  44. Debug("Item dropped.");
  45. kill_this_task();
  46. }
  47.  
  48.  
  49.